<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="keywords" content="{$game['name']}">
    <title>{$game['name']}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="apple-touch-fullscreen" content="yes">
    
    <meta content="telephone=no" name="format-detection">
    <link href="__CSS__/swiper.min.css" rel="stylesheet" >
    <link href="__CSS__{$skin}common.css" rel="stylesheet" >
    <script src="__JS__/jquery-1.11.1.min.js"></script>
    <script src="__JS__/swiper-3.4.2.jquery.min.js"></script>
  <script src="__STATIC__/jquery.cookie.js"></script>
    <script src="__JS__/common.js"></script>
    <script src="__STATIC__/common.js"></script>
    <script src="__JS__/pop.lwx.min.js"></script>
  </head>
  <body <if condition="CONTROLLER_NAME eq 'Search'"> class="searchpage" <elseif condition="CONTROLLER_NAME eq 'Article'"/>class="newspage" <elseif condition="ACTION_NAME eq 'mall_record'"/> class="integral-record"<elseif condition="ACTION_NAME eq 'user_auth' or ACTION_NAME eq 'user_bind_phone'"/> class="user-auth"<elseif condition="ACTION_NAME eq 'user_auth' or ACTION_NAME eq 'user_bind_modify'"/> class="user-auth"<elseif condition="ACTION_NAME eq 'user_auth' or ACTION_NAME eq 'user_bind_modifyed'"/> class="user-auth"<elseif condition="ACTION_NAME eq 'user_auth' or ACTION_NAME eq 'user_password'"/> class="user-auth"<elseif condition="ACTION_NAME eq 'user_login'"/> class="user-auth"<elseif condition="ACTION_NAME eq 'user_register'"/> class="user-auth" <elseif condition="ACTION_NAME eq 'user_address' or ACTION_NAME eq 'user_my_tracks'"/> class="user-balance" <elseif condition="ACTION_NAME eq 'user_gift'"/> class="user-gift" <elseif condition="ACTION_NAME eq 'user_collectioned'"/> class="user-collection" <elseif condition="ACTION_NAME eq 'user_collection'"/> class="user-collection" <elseif condition="ACTION_NAME eq 'user_contact'"/> class="user-contact" <elseif condition="ACTION_NAME eq 'user_argeement'"/> class="user-contact"<elseif condition="ACTION_NAME eq 'user_message'"/> class="user-message"</if> >
    <block name="body"></block> 

    <footer class="footer">
      <section class="wrap">
        <div class="nav table">
          <a class="item table-cell <if condition='CONTROLLER_NAME eq "Index" or CONTROLLER_NAME eq "Game"'>active</if>" href="/"><i class="icon icon-game"></i><span>游戏</span></a>
          <!--<a class="item table-cell <if condition='CONTROLLER_NAME eq "GameNotify"'>active</if>" href="{:U('GameNotify/index')}"><i class="icon icon-game"></i><span>游戏</span></a>-->
          <a class="item table-cell <if condition='CONTROLLER_NAME eq "Gift"'>active</if>" href="/gift"><i class="icon icon-gift"></i><span>礼包</span></a>
          <if condition="$union_set eq ''">
          <a class="jsshopmall item table-cell <if condition='CONTROLLER_NAME eq "PointShop"'>active</if>" href="/mall"><i class="icon icon-mall"><if condition="$mallissignin eq 1"><i class="circle"></i></if></i><span>商城</span></a>
          </if>
          <a class="item table-cell <if condition='CONTROLLER_NAME eq "Subscriber"'>active</if>" href="/self"><i class="icon icon-user"><if condition="$newmsg eq 1"><i class="circle"></i></if></i><span>我的</span></a>
        </div>
      </section>
    </footer>
  <a href="javascript:;" style="display: none;" class="hbtn right table login jslogin"><span class="table-cell"><i class="">登录</i></span></a>
    {$logdiv}
    <php>
      $isQQ = false;
    if (preg_match('/qq/i',$_SERVER['HTTP_USER_AGENT' ]) && !preg_match('/mqqbrowser/i',$_SERVER['HTTP_USER_AGENT' ])){
      $isQQ = ture;
    } 
  </php>
    <div class="loginbutdiv hidden">
      
        <if condition="$wx_login eq 1 && !$isQQ">
          <a href="javascript:;" onclick="register('weixin')" class="butn"><img src="__IMG__/login_third_weixin.png"></a>
        </if>
        
        <if condition="$qq_login eq 1">
          <a href="javascript:;" onclick="register('qq')" class="butn"><img src="__IMG__/login_third_qq.png"></a>
        </if>
        <if condition="$wb_login eq 1">
          <a href="javascript:;" onclick="register('weibo')" class="butn"><img src="__IMG__/login_third_sina.png"></a> 
        </if>
        <if condition="$bd_login eq 1">
          <a href="javascript:;" onclick="register('baidu')" class="butn"><img src="__IMG__/icon_baidu@3x.png"></a>
        </if>
    </div>
    <a style="display:none" href="#shell/WXThirdLogin" id="weixinThirdLogin"></a>
    <a style="display:none" href="#shell/QQThirdLogin" id="qqThirdLogin"></a>
    <form id="app_third_login" action="{:U('Subscriber/app_third_login')}" method="post" enctype="multipart/form-data" style="display:none">
      <input type="text" name="openID" id="openID"/></p>
      <input type="text" name="nickName" id="nickName"  />
      <input type="text" name="icon" id="icon"/>
      <input type="text" name="logintype" id="logintype"/>
      <input type="text" name="gid" value="{:I('game_id',0)}"/>
      <input type="text" name="pid" value="{:(session('union_host')['union_id'])?(session('union_host')['union_id']):I('pid',0)}"/>
      <input type="submit" value="提交" />
    </form>
    
    <div id="red-envelope-bg" style="display:none;">
        <div class="table">
            <div class="table-cell">
                <div class="content-box">
                    <a href="javascript:;" class="close-pop js-close-pop"></a>
                    <div class="red-envelope-content">
                        <a href="http://{$_SERVER['HTTP_HOST']}/mediawide.php/index/download.html" style="font-size: 0.53rem;color: red">点击领取</a>
                        <img src="__IMG__/make_money/money@2x.png" class="money-icon">
                        <a href="http://{$_SERVER['HTTP_HOST']}/mediawide.php/index/download.html" class="get-butn">
                            <img src="__IMG__/make_money/get@2x.png">
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
      //关闭新人红包弹窗
      <if condition="cookie('is_new')">
        if(document.cookie.indexOf("invite_close=1")==-1) {
          $('#red-envelope-bg').show();
        }
        document.cookie="invite_close=1";
      </if>
      $('.js-close-pop').click(function(){
          $('#red-envelope-bg').fadeOut();
      });
/*       try{
        controller = "{:CONTROLLER_NAME}";
        action = "{:ACTION_NAME}";
        param = '{:empty(I(''))?'':json_encode(I(''))}';
        $.ajax({
            url:"{:U('record_page_view')}",
            data:{controller:controller,action:action,param:param},
            type:'post',
            async:true,
            success:function(){
              console.log('pageview记录成功');
            },error:function(){
              console.log('pageview记录失败');
            }
        })
      }catch(error){
        console.log('pageview记录失败,继续执行');
      }
      try{
        controller = "{:CONTROLLER_NAME}";
        action = "{:ACTION_NAME}";
        var _beforeUnload_time = 0, _gap_time = 0;
        var is_fireFox = navigator.userAgent.indexOf("Firefox")>-1;//是否是火狐浏览器
        window.onunload = function (){
          _gap_time = new Date().getTime() - _beforeUnload_time;
          if(_gap_time <= 5)
            Ajapost();
        }
        window.onbeforeunload = function (){
        _beforeUnload_time = new Date().getTime();
        if(is_fireFox)//火狐关闭执行
          Ajapost();
        };
        function Ajapost(){
            $.ajax({
                url:"{:U('leavepage')}",
                type:'post',
                data:{controller:controller,action:action,param:param},
                async:true,
                success:function(){
                  console.log(11);
                }

            });
        } 
      }catch(error){
        console.log(error);
      }
      */
      var gid = "{$game_id}";
      var pid = "{$promote_id}"; 
    </script>
    <script>

        $("body").on("click",'.butnbox a.butnlogin',function(){
            res = jslogin();
            return res;
        });
        function jslogin(){
            $uid = "{:is_login()}";
            if($uid<=0){
              $('.jslogin').click();
              return false;
            }else{
              return true;
            }
        }
    </script>
    <script type="text/javascript">
      url = "{$_SERVER['HTTP_HOST']}"+"{:U('Subscriber/serverNotice')}";
      // WebSocketTest(url);
      function WebSocketTest(url){
        if ("WebSocket" in window)
        {
           // 打开一个 web socket
           var ws = new WebSocket("ws://"+url);
           ws.onopen = function()
           {
              // Web Socket 已连接上，使用 send() 方法发送数据
              ws.send("发送数据");
              alert("数据发送中...");
           };
           ws.onmessage = function (evt) 
           { 
              var received_msg = evt.data;
              alert("数据已接收...");
           };
           ws.onclose = function()
           { 
              // 关闭 websocket
              alert("连接已关闭..."); 
           };
        }
        else
        {
           // 浏览器不支持 WebSocket
           alert("您的浏览器不支持 WebSocket!");
        }
      }
    </script>
  <script type="text/javascript">
      //设置cookie有效期
      // var date = new Date();
      // date.setTime( date.getTime()+30*1000);//有效期30秒

      // if(!$.cookie('access_log')){
      //     //存入cookie
      //     $.cookie('access_log','1',{ expires: date });
      //     var url = "{:U('base/access_log')}";
      //     $.post(url,'',function(res){})
      // }
  </script>
  <script>
if(('standalone' in window.navigator)&&window.navigator.standalone){
        var noddy,remotes=false;
        document.addEventListener('click',function(event){
                noddy=event.target;
                while(noddy.nodeName!=='A'&&noddy.nodeName!=='HTML') noddy=noddy.parentNode;
                if('href' in noddy&&noddy.href.indexOf('http')!==-1&&(noddy.href.indexOf(document.location.host)!==-1||remotes)){
                        event.preventDefault();
                        document.location.href=noddy.href;
                }
        },false);
}

function h5shell_reLogin() {
    window.location.href = "http://{$_SERVER['HTTP_HOST']}/mobile.php/Subscriber/user";
}

if("{:session('session_pro_media_id')}"==15){
  $('html').css('height','100vh');
  //ios隐藏底部导航
  try {
      // 注意这里就算不想传参数 也要传一个空字符串''过来 
      window.webkit.messageHandlers.bottomcontroll.postMessage('我是js传递过来的数据');
  } catch (e) {
      console.log('ios隐藏底部导航失败');
  }
}
</script>

<notempty name="union_set">
{$union_set['site_statcode']}
<else/>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?1213c296f3d34efb9c7c97ae1788b26f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();

(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https'){
   bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();

</script>
<script>if(("standalone" in window.navigator) && window.navigator.standalone){
      var noddy, remotes = false;
      document.addEventListener('click', function(event) {
        noddy = event.target;
        while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
          noddy = noddy.parentNode;
        }
        if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes)){
          event.preventDefault();
          document.location.href = noddy.href;
        }
      },false);
    }</script>
</notempty>
  </body>
</html>